package com.xinghen.common.base;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * @author xinghen
 * @ClassName: GlobalConstant
 * @Package: com.xinghen.common.core.enums
 * @Description 全局常量
 * @create 2018-04-11 15:43
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class GlobalConstant {

    public static final String UNKNOWN = "unknown";

    /**
     * 配置相关类
     */
    public interface Config {

        /**
         * 项目配置前缀
         */
        String ROOT_PREFIX = "xinghen.cloud";

    }

    /**
     * 日期时间相关类
     */
    public interface Time {

        /**
         * 默认时区
         */
        String DEFAULT_TIME_ZONE = "GMT+8";

        /**
         * 通用日期时间格式化模板
         */
        String COMMON_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";

        /**
         * 日期格式化模板
         */
        String DATE_FORMAT_PATTERN = "yyyy年MM月dd日";

        /**
         * 时间格式化模板
         */
        String TIME_FORMAT_PATTERN = "HH:mm:ss";

    }

    /**
     * 项目配置相关类
     */
    public interface Project {

        /**
         * 版本信息
         */
        String VERSION = "1.0.0";

        /**
         * 许可证
         */
        String LICENSE = "Apache License 2.0";

        /**
         * 许可证URL
         */
        String LICENSE_URL = "http://www.apache.org/licenses/LICENSE-2.0";

        /**
         * 联系人
         */
        String CONTACT_NAME = "xinghen";

        /**
         * 联系人URL
         */
        String CONTACT_URL = "";

        /**
         * 联系人邮箱
         */
        String CONTACT_EMAIL = "";
    }

    /**
     * zookeeper配置相关
     */
    public interface Zookeeper {

        String REGISTRY_ID_ROOT_PATH = "/xinghen/cloud/registry/id";

        String ZK_REGISTRY_SEQ = "/xinghen/cloud/seq";
    }

    /**
     * 特殊字符常量
     */
    public interface Symbol {

        String COMMA = ",";

        String SPOT = ".";

        String UNDER_LINE = "_";

        String PER_CENT = "%";

        String AT = "@";

        String PIPE = "||";

        String SHORT_LINE = "-";

        String SPACE = " ";

        String SLASH = "/";

        String MH = ":";

    }

    /**
     * request相关常量
     */
    public interface Request {

        String X_FORWARDED_FOR = "X-Forwarded-For";

        String X_REAL_IP = "X-Real-IP";

        String PROXY_CLIENT_IP = "Proxy-Client-IP";

        String WL_PROXY_CLIENT_IP = "WL-Proxy-Client-IP";

        String HTTP_CLIENT_IP = "HTTP_CLIENT_IP";

        String HTTP_X_FORWARDED_FOR = "HTTP_X_FORWARDED_FOR";

        String LOCALHOST_IP = "127.0.0.1";

        String LOCALHOST_IP_16 = "0:0:0:0:0:0:0:1";

        int MAX_IP_LENGTH = 15;

    }

    /**
     * 系统常量
     */
    public interface Sys {

        /**
         * 全局用户名
         */
        String CURRENT_LOGIN_USER = "CURRENT_LOGIN_USER";

        /**
         * 超管用户ID
         */
        Long SUPER_MANAGER_USER_ID = 1L;

        /**
         * 超管用户名称
         */
        String SUPER_MANAGER_USER_NAME = "admin";

        /**
         * 超级管理员角色ID
         */
        Long SUPER_MANAGER_ROLE_ID = 1L;
        /**
         * 超级管理员组织ID
         */
        Long SUPER_MANAGER_GROUP_ID = 1L;

        /**
         * 运营工作台ID
         */
        Long OPERATION_APPLICATION_ID = 1L;

        /**
         * 菜单根目录
         */
        String MENU_ROOT = "root";

        String USER_AGENT = "User-Agent";
    }

    /**
     * 业务日志常量
     */
    public interface BusinessLog {

        /**
         * TODO:保存业务日志的URL
         */
        String SAVE_LOG_URL = "";
    }
}
